Passport is a Node.js authentication middleware that delegates authentication to pluggable strategies. NestJS wraps Passport via @nestjs/passport, bridging strategies into the NestJS guard and DI system. Each strategy is an @Injectable() provider that extends PassportStrategy(). The validate() return value becomes request.user.
Each Passport strategy is an @Injectable() NestJS provider extending PassportStrategy(Strategy, 'name').
PassportModule.register({ defaultStrategy }) sets the strategy used when no explicit name is given to AuthGuard().
NestJS turns the strategy's validate() return value into the request.user object.
AuthGuard('strategy-name') wraps a Passport strategy as a NestJS guard — canActivate() delegates to Passport.
Strategies have full DI support — inject UsersService, ConfigService, or any other provider in the constructor.